vice-versa

Table 2.2: Relational Operators

Refer to the following code:

// SPDX-License-Identifier: Some Identifier

pragma solidity ^0.8.10;

contract RelationalContract {

uint a = 10;

uint b = 2;

function isEqual() public view returns(bool) {

return a == b;

}

function isNotEqual() public view returns(bool) {

return a != b;

}

function isGreaterThan() public view returns(bool) {

return a > b;

}

function isSmallerThan() public view returns(bool) {

return a < b;

}

function isGreaterThanEqualTo() public view returns(bool) {

return a >= b;

}

function isSmallerThanEqualTo() public view returns(bool) {

return a <=b;

}

}

The preceding example shows a sample code for each. The return

value for each of the preceding function is in bool or Boolean.